<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui" xmlns="http://www.w3.org/1999/xhtml"
	xml:lang="en" lang="en"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:body>
	<h:outputScript library='javascripts'
		name="query.maskedinput-1.2.2.min.js" />
	<h:outputScript>

	</h:outputScript>
	<ui:composition template="/protegido/main.xhtml">
		<ui:define name='conteudoPrincipal'>

			<h:outputScript>
				$(document).ready(function() {
					$("#navigation li.disciplinasProf a").addClass("active");
					$("#navigation li").parent().find('li').removeClass("active");
					if ($("#disciplinasProf")){
						$("#disciplinasProf").addClass("active");
					}
				});
			</h:outputScript>
			<style type="text/css" media="screen">
form {
	height: auto;
}

form .item-passos {
	font-size: 18px;
	margin-bottom: 15px;
	padding-bottom: 0px;
}

#campos-gerais {
	width: 28%;
	min-height: inherit;
	height: inherit;
	overflow: hidden;
	float: left;
	padding-right: 15px;
	margin-left: 15px;
	margin-bottom: 15px;
}

#campos-especificos {
	width: 28%;
	min-height: inherit;
	margin-left: 30px;
	min-height: 420px;
	height: inherit;
	overflow: hidden;
	float: left;
	border-left: 1px solid #dfdfdf;
	padding-left: 20px;
	margin-right: 30px;
	margin-bottom: 15px;
}

#campos-questoes {
	width: 28%;
	min-height: inherit;
	margin-left: 0px;
	min-height: 420px;
	height: inherit;
	overflow: hidden;
	float: left;
	border-left: 1px solid #dfdfdf;
	padding-left: 20px;
	padding-right: 20px;
	margin-bottom: 15px;
}

form input[type="text"],form input[type="password"] {
	width: 213px;
}

#dtEncerramento_input,#dataAbertura_input {
	width: 228px;
	height: 18px;
	margin: 0px;
	margin-top: 7px;
	margin-left: -5px;
}

form input.w30 {
	width: 30px;
}

form input.w80 {
	width: 75px;
}

form span {
	font-size: 10px;
	color: #666;
	margin-left: 5px;
}

form span a {
	font-size: 10px;
	font-weight: bold;
	color: red;
}

form input.w120 {
	width: 175px;
}

form .input-submit {
	text-align: right;
	margin-top: 30px;
}

.campo-form {
	margin-top: 5px;
	margin-left: 20px;
}

#temas * {
	border: none !important;
	padding: 0 !important;
	font-weight: normal;
}

#temas {
	width: 95%;
	text-align: center;
	margin-left: 0px;
	margin-bottom: 10px;
	text-transform: none;
}

#botao label:hover {
	text-decoration: underline;
	background-color: rgba(0, 0, 0, 0.5);
}

#botao label {
	border: 0;
	font-size: 9px;
	font-weight: normal;
	text-transform: uppercase;
	color: #000;
	cursor: pointer;
	vertical-align: middle;
	background-color: #a11e06;
}

#botao label,#botao * {
	color: #fff !important;
}

.fileupload-buttonbar {
	padding: 0em 0em;
	width: 147px;
	text-align: right;
}

.ui-button-text-icon-left .ui-button-text {
	padding: .5em 1em .4em 2em;
	border: none;
}
</style>

			<div class="ui-widget">
				<h:messages id="msg"
					style="font-size: 12px; margin-top: 20px; margin-bottom: 20px; padding: 10px 0.7em;"
					class="ui-state-error ui-corner-all" />
			</div>

			<h2>Cadastrar Nova Prova</h2>
			<h:form id="novoProva" prependId="false">
				<div id="campos-gerais">
					<div class="item-passos">.: Dados Gerais</div>
					<div class="campo-form">
						<label for="descricao">Descrição: </label><br />
						<h:inputTextarea name="descricao" class="text"
							value="#{descricao}" id="descricao" />
					</div>
					<div class="campo-form">
						<label for="tipo">Tipo de prova: *</label><br />
						<h:selectOneMenu id="tipo" name="tipo" value="#{tipo}"
							class="select" required="true" style="width:240px; height:25px;">
							<f:selectItems value="#{provaMB.tiposProva}" var="t"
								itemValue="#{t}" itemLabel="#{t}" />
						</h:selectOneMenu>
					</div>
				</div>
				<div id="campos-especificos">
					<div class="item-passos">.: Agendamento</div>
					<div class="campo-form">
						<label for="peso">Peso: *</label><br /> <span>Valor Min.=
							0</span> <br />
						<p:spinner id="peso" name="peso" min="0"
							style="margin-left:0px; margin-top:8px; text-align:left;"
							value="#{peso}" required="true" />
					</div>



					<div class="campo-form">
						<label for="dtAbertura">Data Abertura:*</label><br />
						<p:calendar effect="fadeIn" name="dtAbertura"
							value="#{dtAbertura}" id="dataAbertura"
							pattern="dd/MM/yyyy HH:mm" required="true">
						
						</p:calendar>
					</div>

					<div class="campo-form">
						<label for="dtEncerramento">Data Encerramento:*</label><br />
						<p:calendar effect="fadeIn" name="dtEncerramento"
							value="#{dtEncerramento}" id="dtEncerramento" required="true"
							style="width:210px;" pattern="dd/MM/yyyy HH:mm">
						</p:calendar>
					</div>
				</div>

				<div id="campos-questoes">
					<div class="item-passos">.: Critérios das Questões</div>
					<div class="campo-form">
						<label for="numQuest">Num. Questões: *</label><br /> <span>Valor
							Min.= 0</span> <br />
						<p:spinner id="numQuest" name="numQuest" min="0"
							style="margin-left:0px; margin-top:8px; text-align:left;"
							value="#{numQuest}" required="true" />
					</div>
					<div class="campo-form">
						<label for="dificuldadeMin">Nível Dificuldade Min: *</label><br />
						<span>Valor Min.= 0</span> <br />
						<p:spinner id="dificuldadeMin" name="dificuldadeMin" min="0"
							style="margin-left:0px; margin-top:8px; text-align:left;"
							value="#{dificuldadeMin}" required="true" />
					</div>
					<div class="campo-form">
						<label for="dificuldadeMax">Nível Dificuldade Max: *</label><br />
						<span>Valor Min.= 0</span> <br />
						<p:spinner id="dificuldadeMax" name="dificuldadeMax" min="0"
							style="margin-left:0px; margin-top:8px; text-align:left;"
							value="#{dificuldadeMax}" required="true" />
					</div>


					<div class="campo-form">
						<label for="temas">Tema(s): * </label><br /> <span>Selecione
							um ou mais temas</span> <br />
						<div style="height: 150px; overflow-y: auto;">
							<h:selectManyCheckbox value="#{temas}" id="temas" required="true">
								<f:selectItems value="#{provaMB.temasQuestoes}" var="t"
									itemValue="#{t.id}" itemLabel="#{t.descricao}" />
							</h:selectManyCheckbox>
						</div>
					</div>

				</div>
				<div class="clearfix"></div>

				<p class="campo-form">
					<span>Todos os campos com o sinal * são obrigatórios</span> <br />
					<h:commandButton type="submit" name="salvar" class="submit"
						value="Cadastrar Prova" id="salvar"
						action="#{provaMB.doSalvarProva(descricao, dificuldadeMax,dificuldadeMin, dtAbertura, dtEncerramento, numQuest, peso, disciplinaMB.disciplina.id, temas,tipo)}"
						update=":msg :novoProva" onclick="this.value='Salvando... ';">
					</h:commandButton>
					<h:commandButton type="submit" name="cancelar" class="submit"
						style="min-width:109px;" value="Cancelar" id="cancelar"
						action="#{provaMB.doCancelar()}" immediate="true" process="@none">
					</h:commandButton>
				</p>

			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>